package com.example.module_service.api

import com.example.lib_common.view.entity.AddPointEntity
import com.example.lib_common.view.entity.CarAddEntity
import com.example.lib_common.view.entity.CarAddParam
import com.example.lib_common.view.entity.CarPayEntity
import com.example.lib_common.view.entity.CarPayParam
import com.example.lib_common.view.entity.CarStopEntityItem
import com.example.lib_common.view.entity.BaseResponse
import com.example.lib_common.view.entity.CarplateEntity
import com.example.lib_common.view.entity.DeviceDetailEntity
import com.example.lib_common.view.entity.DeviceEntity
import com.example.lib_common.view.entity.PatrolEntity
import com.example.lib_common.view.entity.PatrolTaskBeanItem
import com.example.module_service.park.ParkBeanItem
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Path

interface ServerApiServer {
    // 核心修改：
    // 1. 路径中添加 {areaId} 占位符（对应路径参数）
    // 2. 用 @Path("areaId") 传递参数（而非 @Query）
    @GET("/api/parking-spaces/area/{areaId}")
    suspend fun getPark(@Path("areaId") areaId: Int): BaseResponse<List<ParkBeanItem>>


    @GET("/api/devices")
    suspend fun getDeviceList():BaseResponse<List<DeviceEntity>>

    // /api/inspection-orders/{id}
    @GET("/api/inspection-orders/{id}")
    suspend fun getDeviceDetail(@Path("id") id: Int):BaseResponse<DeviceDetailEntity>

    ///api/vehicles/getProvinces}
    @GET("/api/vehicles/getProvinces")
    suspend fun getProvince():BaseResponse<List<CarplateEntity>>

    //增加车辆信息
    @POST("/api/vehicles")
    suspend fun getAddCar(@Body carAddEntity: CarAddParam): BaseResponse<CarAddEntity>
    //增加消费记录
    @POST("/api/parking-payments")
    suspend fun getAddCarPay(@Body carPayParam: CarPayParam):BaseResponse<CarPayEntity>
    //获取停车记录
    @GET("/api/parking-payments")
    suspend fun getCarStop():BaseResponse<List<CarStopEntityItem>>
    //获取巡检点位 /api/patrol-points
    @GET("/api/patrol-points")
    suspend fun getPatrol():BaseResponse<List<PatrolEntity>>

    //创建点位/api/patrol-points
    @POST("/api/patrol-points")
    suspend fun addPoint(@Body addPointEntity: AddPointEntity):BaseResponse<AddPointEntity>
    //巡检点位
    @GET("/api/patrol-tasks/by-status/{status}")
    suspend fun getPatrolTaskByStatus(@Path("status")status:String):BaseResponse<List<PatrolTaskBeanItem>>
    //获取巡检任务详情
    @GET("/api/patrol-tasks/{id}")
    suspend fun getTaskById(@Path("id")id:Int):BaseResponse<PatrolTaskBeanItem>


}